{% load text_filters %}

<div class="block network-block" id="{{ group.code }}">
    <a href="#{{ group.code }}" class="network-header">{{ group.title }}</a>

    {% if group.rooms %}
        <div class="network-channels">
            {% for room in group.rooms.all %}
                {% if room.is_visible and room.get_private_url %}
                    <a href="{{ room.get_private_url }}" target="_blank" class="network-channel {% if forloop.counter > 4 %}network-channel-small{% endif %}">
                        {% if room.image %}
                            <span class="avatar network-channel-image"><img src="{{ room.image }}" alt="{{ room.title }}"></span>
                        {% endif %}

                        {% if room.title %}
                            <span class="network-channel-name">{{ room.title | safe  }}</span>
                        {% endif %}
                    </a>
                {% endif %}
            {% endfor %}
        </div>
    {% endif %}

    {% if group.text %}
        <div class="network-channel-text">
            {{ group.text | markdown }}
        </div>
    {% endif %}
</div>
